﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using You.Niao.ShaFa.Model;
using You.Niao.ShaFa.IDAL;
using DBUtility;
using Common.Base;

namespace You.Niao.ShaFa.DAL
{
    public  class ProvinceDAL:SqlConn,IProvince
    {
        public PcaModel GetList()
        {
            PcaModel list = new PcaModel();
            list.PList = new List<province>();
            list.CList = new List<city>();
            list.AList = new List<area>();
            using (SqlDataReader dr = DbHelperSQL.ExecuteReader(ShaFaConn, "select code,name from province"))
            {
                while (dr.Read())
                {
                    province model = new province();
                    model.code = dr["code"].ToString();
                    model.name = dr["name"].ToString();
                    list.PList.Add(model);
                }
            }
            return list;
        }
    }
}
